import { getUpDateList } from "../../utils/api";
import { getRecommendList } from "../../utils/api";
import { getFreeTodayList } from "../../utils/api";
import { getCompere } from "../../utils/api";
const slowTell = {
  state() {
    return {
      // 当前在更
      getUpDateList: "",
      // 编辑推荐
      getRecommendList: "",
      // 今日限免
      getFreeTodayList: "",
      // 知名谈话节目主持人
      getCompere: "",
    };
  },
  mutations: {
    // 当前在更
    getUpDateList(state, payload) {
      state.getUpDateList = payload;
    },
    // 编辑推荐
    getRecommendList(state, payload) {
      state.getRecommendList = payload;
    },
    // 今日限免
    getFreeTodayList(state, payload) {
      state.getFreeTodayList = payload;
    },
    // 知名谈话节目主持人
    getCompere(state, payload) {
      state.getCompere = payload;
    },
  },
  actions: {
    // 当前在更
    async getUpDateList({ commit }) {
      const res = await getUpDateList();
      commit("getUpDateList", res);
    },
    // 编辑推荐
    async getRecommendList({ commit }) {
      const res = await getRecommendList();
      commit("getRecommendList", res);
    },
    // 今日限免
    async getFreeTodayList({ commit }) {
      const res = await getFreeTodayList();
      commit("getFreeTodayList", res);
    },
    // 知名谈话节目主持人
    async getCompere({ commit }) {
      const res = await getCompere();
      commit("getCompere", res);
    },
  },
};
export default slowTell;
